import request from '../../utils/request'

// 查询电价列表
export function listInfo(query) {
  return request({
    url: '/electric-price-info/electric-price-info/',
    method: 'get',
    params: query
  })
}

// 查询某类型电价对应的电价详细
export function getInfo(priceId) {
  return request({
    url: '/electric-price-info/electric-price-info/' + priceId +'/values',
    method: 'get'
  })
}

// 新增电价信息
export function addInfo(data) {
  return request({
    url: '/electric-price-info/electric-price-info/',
    method: 'post',
    data: data
  })
}

// 修改【请填写功能名称】
export function updateInfo(data) {
  return request({
    url: '/system/info',
    method: 'put',
    data: data
  })
}

// 删除电价信息
export function delInfo(priceId) {
  return request({
    url: '/electric-price-info/electric-price-info/' + priceId,
    method: 'delete'
  })
}

export function exportInfoByIds(ids) {
  return request({
    url: '/electric-price-info/parameters/detail/export_prices_by_ids',
    method: 'post',
    data: ids,
    responseType: 'blob' // 设置响应类型为blob
  })
}

export function deleteInfoByIds(ids) {
  return request({
    url: '/electric-price-info/electric-price-info/batch',
    method: 'delete',
    data: ids
  })
}

export  function predictElectricPrice(type,ids) {
  return request({
    url: '/prediction/predict',
    method: 'post',
    data: {
      type: type,
      id: ids
    }
  })
}
